package com.boarsoft.web.controller;

import org.springframework.beans.factory.annotation.Autowired;

import com.boarsoft.boar.auth.SysUserService;
import com.boarsoft.boar.sys.entity.SysUser;
import com.boarsoft.cache.aop.Cached;

public class BaseController {
	@Autowired
	protected SysUserService userSvc;

	@Cached(group = "user")
	public SysUser getSysUser(String id) {
		SysUser o = userSvc.get(id);
		SysUser u = new SysUser();
		u.setId(o.getId());
		u.setCode(o.getCode());
		u.setEmail(o.getEmail());
		u.setCorpId(o.getCorpId());
		u.setDeptId(o.getDeptId());
		u.setName(o.getName());
		u.setPosition(o.getPosition());
		u.setPhone(o.getPhone());
		return u;
	}
}
